<!--
 * @Author: yushuang
 * @Date: 2024-12-03 15:58:14
 * @LastEditors: yushuang
 * @LastEditTime: 2024-12-19 16:56:54
 * @Description: 
-->
<script setup lang="ts">
import { storeToRefs } from 'pinia';
import { useAppStore } from '@/stores/app';
import { useLayoutMenu } from '@/stores/layout-menu';
import { useLayoutMenuProvide } from '@/components/page-container/context';
import TokenProvider from '@/components/token-provider/index.vue';
import actions from '@/utils/actions';

const appStore = useAppStore();
const { theme } = storeToRefs(appStore);
const layoutMenu = useLayoutMenu();
useLayoutMenuProvide(layoutMenu, appStore);

// 监听qiankun全局state方法
actions.onGlobalStateChange(actionState => {
  const { from, data } = actionState;
  console.log('---主应用监听全局onGlobalStateChange---', from, data);
});
</script>

<template>
  <a-config-provider :theme="theme">
    <a-app class="h-full font-chinese antialiased">
      <TokenProvider>
        <RouterView />
      </TokenProvider>
    </a-app>
  </a-config-provider>
</template>
